package one.two.three;

import java.awt.geom.Point2D;
import java.util.Random;
import java.util.Scanner;

import edu.princeton.cs.algs4.Interval1D;
import edu.princeton.cs.algs4.Interval2D;
import edu.princeton.cs.algs4.StdDraw;

public class Inter2D {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);

		int n = s.nextInt();
		double min = s.nextDouble();
		double max = s.nextDouble();
		Interval2D[] d = new Interval2D[n];

		Random r = new Random();
		double a, b;
		Interval1D x, y;
		for (int i = 0; i < n; i++) {
			a = r.nextDouble();
			b = r.nextDouble();
			if (a <= b)
				x = new Interval1D(a, b);
			else
				x = new Interval1D(b, a);

			a = r.nextDouble();
			b = r.nextDouble();
			if (a <= b)
				y = new Interval1D(a, b);
			else
				y = new Interval1D(b, a);

			d[i] = new Interval2D(x, y);

		}
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				if (d[i].intersects(d[j])) {
					System.out.println(d[i] + " intersect" + d[j]);
				}
			}
		}

		for (int i = 0; i < n; i++) {
			d[i].draw();
		}

	}

}
